package com.example.javasample.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.javasample.domain.UserDO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
 * UserMapper
 *
 * @author Kylin
 */
public interface UserMapper extends BaseMapper<UserDO> {

//    @Results(id = "userDetailResult", value = {
//            @Result(property = "id", column = "id", id = true),
//            @Result(property = "name", column = "name")
//    })
    @Select("select * from user where deleted = 0 and id = #{userId}")
    UserDO detailResult(@Param("userId") Long userId);

}
